﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ExamManagementSystem
{
    /// <summary>
    /// 教员登录后的主窗体
    /// </summary> 
    public partial class TeacherForm : Form
    {
        public TeacherForm()
        {
            InitializeComponent();
        }

        // 点击退出时，退出应用程序
        private void tsmiExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        // 点击时，打开新增试题窗体
        private void tsmiAddQuestion_Click(object sender, EventArgs e)
        {
            AddQuestionForm add = new AddQuestionForm();
            add.Show();
        }

        // 点击菜单中的“帮助”->”关于”，以模式窗口显示 About 窗体
        private void tsmiAbout_Click(object sender, EventArgs e)
        {
           
        }

        // 窗体加载事件处理
        private void TeacherForm_Load(object sender, EventArgs e)
        {
            // 设置状态栏标签显示的文字
            lblTeacher.Text = string.Format("教师{0}登录了！",UserHelper.loginId);
        }

        // 显示查询试题窗体
        private void tsmiSearchQuestion_Click(object sender, EventArgs e)
        {
            SearchQuestionForm searchForm = new SearchQuestionForm();
            searchForm.MdiParent = this;
            searchForm.Show();
        }

        // 显示试题列表窗体
        private void tsmiQuestionList_Click(object sender, EventArgs e)
        {
            QuestionListForm questionListForm = new QuestionListForm();
            questionListForm.MdiParent = this;
            questionListForm.Show();
        }

        // 窗体关闭后，退出应用程序
        private void TeacherForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }
        //添加科目
        private void tsmAddSubject_Click(object sender, EventArgs e)
        {
            AddSubjectForm asf = new AddSubjectForm();
            asf.Show();
        }
        //添加知识点
        private void tsmAddKnowledge_Click(object sender, EventArgs e)
        {
            AddKnowledgeForm akf = new AddKnowledgeForm();
            akf.Show();
        }

        private void btnTestPaper_Click(object sender, EventArgs e)
        {
            ExamPaper ep = new ExamPaper();
            ep.Show();
        }
    }
}